babl-verify: fix win32 compile, with s/setenv/putenv/g
authorEdward E <develinthedetail@gmail.com>
Wed, 23 Nov 2016 20:35:39 +0000 (14:35 -0600)
committerØyvind Kolås <pippin@gimp.org>
Wed, 23 Nov 2016 21:22:10 +0000 (22:22 +0100)
Wouldn't compile on windows because putenv() takes 1 arg, not 2.
Win32 has no setenv(), pippin said try using putenv() on all platforms.

tools/babl-verify.c

index 3e2a7e4399f28cd5a58b88228b6a3c75314b8a07..80174db50e88c759a55c37f624e5756abda2313f 100644 (file)
@@ -2,10 +2,6 @@
 #include <stdlib.h>
 #include "babl/babl.h"
 
-#ifdef _WIN32
-#define setenv(a,b,c)  putenv((a),(b))
-#endif
-
 int main (int argc, char **argv)
 {
   if (argc != 3)
@@ -13,8 +9,8 @@ int main (int argc, char **argv)
     fprintf (stderr, "need two args, from and to babl-formats\n");
     return -1;
   }
-  setenv ("BABL_DEBUG_CONVERSIONS", "1", 0);
-  setenv ("BABL_TOLERANCE", "100000.0", 0);
+  putenv ("BABL_DEBUG_CONVERSIONS" "=" "1");
+  putenv ("BABL_TOLERANCE"         "=" "100000.0");
   babl_init ();
   babl_fish (babl_format(argv[1]), babl_format (argv[2]));
   babl_exit ();